const express = require("express")

const router = express.Router()

const { query } = require("../db/db")

router.get("/userInfo", (req, res) => {
  let sql = "select * from userInfo"
  let value = []
  query(sql, value, (row) => {
    if(row.code === '200') {
      res.json({...row,msg:'ok'})
      return
    }
    res.json({...row,msg:'查询失败'})
  })
})

router.post("/register", (req, res) => {
  let sql = "select * from userInfo"
  let value = []
  query(sql, value, (row) => {
    res.json(row)
  })
})

module.exports = router
